home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Headers / misckit / miscgiskit / MiscCoord.h < prev    next >
Encoding:
Text File  |  1995-07-08  |  2.2 KB  |  78 lines

  1. /*=============================== MiscCoord.h ===============================*/
  2. /* MiscCoord is an abstract super class which contains and supports double
  3.    precision floating point values representing locations in a three
  4.    dimensional coordinate system.
  5.  
  6.    DMA Release 0.8, Copyright @1993 by Genesis Project, Ltd. All Rights
  7.    Reserved. For further information on terms and conditions see
  8.         the MiscKit license.
  9.  
  10. HISTORY
  11. 22-Feb-93  Dale Amon at GPL
  12.        Created.
  13. */
  14.  
  15. #import <appkit/appkit.h>
  16. #import <misckit/miscgiskit.h>
  17.  
  18. #define    MISC_COORD_VERSION_ID    0.8
  19.  
  20. #define MISC_DIMENSIONS        3        /* 3d coordinates */
  21. #define MISC_ELEMENT_DESCRIPTION    "[3d]"        /* description of one point */
  22. #define MISC_DEFAULT_POINT_CAPACITY    1
  23.  
  24. /* Define some constants with 21 significant digits starting from 21
  25.    digits of Pi
  26. */
  27. #import <ansi/math.h>
  28. #define    MISC_RADIANS_PER_DEGREE    (M_PI/180.0)
  29. #define    MISC_DEGREES_PER_RADIAN    (180.0/M_PI)
  30.  
  31. /* round off at 15 digit after decimal point. This cures some problems with
  32.    going back and forth between radians and degrees */
  33.  
  34. #define MISC_ROUND_OFF    .000000000000005
  35.  
  36. @interface MiscCoord:Object <MiscCoordConverterClient>
  37. {
  38.     char                            *description;
  39.     unsigned int                    curIndex, curBlockSize;
  40.     id                                constants;
  41.     id <MiscCoordConverterServer>    converter;
  42.     Storage                            *pntStorage;
  43. }
  44.  
  45. +initialize;
  46.  
  47. -initDescription: (char *) txt
  48.        converter: (id <MiscCoordConverterServer>) aConverter
  49.        constants: anObject;
  50. -init;
  51. -free;
  52.  
  53. -(BOOL) convert:      (id <MiscCoordConverterClient>) aCoord;
  54. -(BOOL) convertCoord: (id <MiscCoordConverterClient>) aCoord;
  55.  
  56. - (id <MiscCoordConverterServer>) converter;
  57. - (const char *)          description;
  58. -                   setDescription: (char *) txt;
  59.  
  60. - (BOOL) selectExistingPoints:  (unsigned int) n blockSize: (unsigned int) m; 
  61. - (BOOL) selectAndSetNumPoints: (unsigned int) n blockSize: (unsigned int) m; 
  62. - (BOOL) selectAndSetMinPoints: (unsigned int) n blockSize: (unsigned int) m;
  63.  
  64. - (unsigned int) numPoints;
  65. - (unsigned int) curIndex;
  66.  
  67. -         setCoord:(double)  c1 : (double)  c2 : (double)  c3;
  68. -         coord:   (double*) c1 : (double*) c2 : (double*) c3;
  69. - (double)    coord1;
  70. - (double)    coord2;
  71. - (double)    coord3;
  72.  
  73. - write:(NXTypedStream *)stream;
  74. - read: (NXTypedStream *)stream;
  75.  
  76. @end
  77.  
  78.